package com.qingke.java.command;

import com.qingke.java.pojo.User;

public abstract class CommandFactory {
	public static enum CommandCode {
		LOGIN, SIGNUP, EXIT, HELP, LIST, SELECT, PAY, SHOPCART, ADD, ORDER, MYINFO
	}

	public static CommandFactory getFactory(User user) {
		if (user == null) {
			return new SystemCommandFactory();
		}else{
			return new UserCommandFactory(user);			
		}
	}

	public abstract Command buildCommand(CommandCode cmdcode);
}
